class CreateCategories < ActiveRecord::Migration
  def self.up
    create_table :categories do |t|
			t.string :title, :null=>false
			t.string :slug
			t.boolean :is_visible, :default=>true
			t.boolean :is_menu, :default=>false
			t.integer :page_id
			t.integer :parent_id
			t.integer :position, :default=>0
			
			t.integer  "root_id",            :limit => 11, :default => 0
    	t.integer  "lft",                :limit => 11, :default => 0
    	t.integer  "rgt",                :limit => 11, :default => 0
    	t.integer  "depth",              :limit => 11, :default => 0
    	t.boolean  "is_inherit",                       :default => false
    	t.text     "brief"
			
      t.timestamps
    end
  end

  def self.down
    drop_table :categories
  end
end
